<!doctype html>
<html lang="en">
<head>
    @include('web.layout.head')
    <link rel="stylesheet" href="{{mix('/css/web/find/message.css')}}">
</head>
<body>
@include('web.layout.header_proscenium')
@include('web.layout.main_header')
@include('web.layout.main_header_nav')
@include('web.layout.pro_banner')
<div class="mess_wrap">
    <div class="mess_hline">
        <div class="mess_hline_p1"><a href="{{asset('')}}">首页></a> <a href="{{asset('find/message')}}" >找项目</a></div>
    </div>
    <div class="mess_content" data-request="{{asset('/find/message')}}">


        <div class="mess_content_crux">
            <p class="p1">关键字&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="text" class="all_input" title="" id="keyword" name="keyword" value="{{array_get($search_params,'keyword')}}">
                <a href="javascript:;">
                    <input type="submit" id="submit_search" value="查询" class="inpuire" />
                </a>
            </p>
        </div>
        <div class="mess_content_choose">
            <ul class="ul1">
                <li class="first_li"><p>公告类型</p></li>
                <li>
                    <select class="all_input select1" title="" name="announcement_type" id="announcement_type">
                        <option value="">请选择</option>
                        <option value="1" @if(array_get($search_params,'announcement_type')==1) selected @endif>采购预报</option>
                        <option value="2" @if(array_get($search_params,'announcement_type')==2) selected @endif>采购公告</option>
                        <option value="3" @if(array_get($search_params,'announcement_type')==3) selected @endif>中标成交公示</option>
                        <option value="4" @if(array_get($search_params,'announcement_type')==4) selected @endif>采购合同公告</option>
                        <option value="5" @if(array_get($search_params,'announcement_type')==5) selected @endif>竞争性磋商公告</option>
                        <option value="6" @if(array_get($search_params,'announcement_type')==6) selected @endif>单一来源公示</option>
                        <option value="7" @if(array_get($search_params,'announcement_type')==7) selected @endif>进口产品公示</option>
                        <option value="8" @if(array_get($search_params,'announcement_type')==8) selected @endif>采购文件或需求公示</option>
                        <option value="9" @if(array_get($search_params,'announcement_type')==9) selected @endif>公示</option>
                    </select>
                </li>
                <li style="margin-left: 12px;"><p>采购方式</p></li>
                <li>
                    <select class="all_input select1" title="" name="purchase_mode" id="purchase_mode">
                        <option value="">请选择</option>
                        <option value="1" @if(array_get($search_params,'purchase_mode')==1) selected @endif>公开招标</option>
                        <option value="2" @if(array_get($search_params,'purchase_mode')==2) selected @endif>邀请招标</option>
                        <option value="3" @if(array_get($search_params,'purchase_mode')==3) selected @endif>竞争性谈判</option>
                        <option value="4" @if(array_get($search_params,'purchase_mode')==4) selected @endif>询价采购</option>
                        <option value="5" @if(array_get($search_params,'purchase_mode')==5) selected @endif>单一来源采购</option>
                        <option value="6" @if(array_get($search_params,'purchase_mode')==6) selected @endif>竞争性磋商</option>
                    </select>
                </li>
                <li style="margin-left: 12px;"><p>采购类型</p></li>
                <li>
                    <select class="all_input select1" title="" name="purchase_type" id="purchase_type">
                        <option value="">请选择</option>
                        <option value="1" @if(array_get($search_params,'purchase_type')==1) selected @endif>政府集中采购</option>
                        <option value="2" @if(array_get($search_params,'purchase_type')==2) selected @endif>部门集中采购</option>
                        <option value="3" @if(array_get($search_params,'purchase_type')==3) selected @endif>分散采购委托代理</option>
                        <option value="4" @if(array_get($search_params,'purchase_type')==4) selected @endif>分散采购自行组织</option>
                        <option value="5" @if(array_get($search_params,'purchase_type')==5) selected @endif>单位自行采购</option>
                    </select>
                </li>
            </ul>
            <ul class="ul2 demo1">
                <li>
                    <p>发布时间&nbsp;&nbsp;</p>
                </li>
                <li>
                    <select class="sel2 all_input select1" title="" id="time" name="time">
                        <option value="">请选择时间</option>
                        <option value="three_day" @if(array_get($search_params,'time')=='three_day') selected @endif>近3天</option>
                        <option value="week" @if(array_get($search_params,'time')=='week') selected @endif>近7天</option>
                        <option value="half_month" @if(array_get($search_params,'time')=='half_month') selected @endif>近半月</option>
                        <option value="month" @if(array_get($search_params,'time')=='month') selected @endif>近一月</option>
                    </select>
                </li>
            </ul>
        </div>
        <div class="mess_content_crux" style="float: left;height: 56px;">
            <p class="p1">地区筛选&nbsp;&nbsp;
                <input class="" type="text" id="selected_city" title="" name="city" autocomplete="off" data-region-id="{{array_get($search_params,'city_id')}}" value="{{array_get($search_params,'city_name')}}"/>
            </p>
            <div class="clearbox">
                <img src="" alt="" width="10" height="10">
            </div>
            @include('web.layout.city_hot')
        </div>
    </div>
    <div class="mess_table">
        <ul class="tit">
            <li class="biaoti">标题</li>
            <li class="leixing">公告类型</li>
            <li>地区</li>
            <li>时间</li>
        </ul>
        <div class="titbox">

        </div>
        @if(!empty($list))
            @foreach($list as $key=>$value)
            <ul class="tit1">
                <li class="biaoti1"><a href="{{asset('find/message/detail')}}/{{$value['project_id']}}">{{$value['title']}}</a></li>
                <li>{{$value['announcement_type_name']}}</li>
                <li style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" title="{{array_get($value,'region.state_city_name')}}">
                    {{array_get($value,'region.state_city_name')}}
                </li>
                <li>{{date('Y-m-d',strtotime($value['created_at']))}}</li>
            </ul>
            @endforeach
        @else
        <ul class="tit1">
            <li class="biaoti1" style="text-align: center;width: 100%!important;">暂无数据</li>
        </ul>
        @endif
        <div class='page'>
            @include('web.common.paginate')
        </div>
    </div>
</div>
@include('web.layout.footer_ware1')
</body>
<script>
$(function () {
    $('#submit_search').click(function () {
        var request_url = $('.mess_content').data('request');

//        var project_type = '';
//        $.each($('.project_type:checked'), function () {
//            if (project_type) {
//                project_type = project_type + ',' + $(this).val();
//            } else {
//                project_type += $(this).val();
//            }
//        });

        var params = [
            'keyword=' + $('#keyword').val(),
            'announcement_type=' + $('#announcement_type option:selected').val(),
            'purchase_mode=' + $('#purchase_mode option:selected').val(),
            'purchase_type=' + $('#purchase_type option:selected').val(),
            'time=' + $('#time option:selected').val(),
            'city_id=' + $('#selected_city').data('region-id'),
            'city_name=' + $('#selected_city').val(),
            //'project_type=' + project_type
        ];

        var url_params = params.join("&");
        location.href = request_url + "?" + url_params;
    });

    $('#sector_submit_search').click(function () {
        var request_url = $('.mess_content').data('request');

        var params = [
            'keyword=' + $('#keyword').val(),
            'time=' + $('#time option:selected').val(),
            'city_id=' + $('#selected_city').data('region-id'),
            'city_name=' + $('#selected_city').val(),
            'type=' + $('#type option:selected').val(),
        ];

        var url_params = params.join("&");
        location.href = request_url + "?" + url_params;
    });
});

</script>
</html>